﻿using System;
using System.ServiceModel.Web;

namespace Restful.Net
{
    /// <summary>
    /// AsyncResult implementation used by the framework to handle the special case when a resource is not found.
    /// </summary>
    public class NotFoundAsyncResult : AsyncResult
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="NotFoundAsyncResult"/> class.
        /// </summary>
        /// <param name="asyncCallback">The async callback.</param>
        /// <param name="state">The state.</param>
        public NotFoundAsyncResult(AsyncCallback asyncCallback, object state)
            : base(asyncCallback, state)
        {
        }
    }

    public class NotAuthenticatedAsyncResult : AsyncResult
    {
        public WebFaultException<string> Error
        {
            get;
            set;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="NotFoundAsyncResult"/> class.
        /// </summary>
        /// <param name="asyncCallback">The async callback.</param>
        /// <param name="state">The state.</param>
        public NotAuthenticatedAsyncResult(AsyncCallback asyncCallback, object state, WebFaultException<string> error)
            : base(asyncCallback, state)
        {
            Error = error;
        }
    }
}